home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / gnustuff / minix / libsrc~1.z / libsrc~1 / stsndrec.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1989-12-28  |  1.1 KB  |  56 lines

  1. #
  2.     .globl    _send
  3.     .globl    _receive
  4.     .globl    _sendrec
  5. #ifdef ACK
  6.         .text
  7.         .data
  8.         .bss
  9. #endif ACK
  10. | =====================================================================
  11. |                           send and receive                          =
  12. | =====================================================================
  13. | send(), receive(), sendrec() destroy d0, d1, and a0.
  14.  
  15. | See ../h/com.h for C definitions
  16. SEND    = 1
  17. RECEIVE    = 2
  18. BOTH    = 3
  19.  
  20.         .text
  21.         .even
  22.  
  23. _send:    movw    #SEND,d0    | send(dest, ptr)
  24.     jra    L0
  25.  
  26.         .text
  27.         .even
  28. _receive:
  29.     movw    #RECEIVE,d0    | receive(src, ptr)
  30.     jra    L0
  31.  
  32.         .text
  33.         .even
  34. _sendrec:
  35.     movw    #BOTH,d0    | sendrec(srcdest, ptr)
  36. L0:                | d0 = SEND/RECEIVE/BOTH
  37. #ifdef __GNUC__
  38. #ifdef __MSHORT__
  39.     movw    sp@(4),d1    | d1 = dest-src
  40.     movl    sp@(6),a0    | a0 = message pointer
  41. #else
  42.     movw    sp@(6),d1    | d1 = dest-src
  43.     movl    sp@(8),a0    | a0 = message pointer
  44. #endif /* __MSHORT__ */
  45. #else
  46.     movw    sp@(4),d1    | d1 = dest-src
  47.     movl    sp@(6),a0    | a0 = message pointer
  48. #endif
  49.     trap    #0        | trap to the kernel
  50. #ifdef __GNUC__
  51. #ifndef __MSHORT__
  52.     extl    d0        | sign extend for 32bit library
  53. #endif
  54. #endif
  55.     rts            | return
  56.